﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace TaobaoERP.Core.Common
{
    public static class AppSettings
    {
        #region Static Properties

        /// <summary>
        /// Alisoft
        /// </summary>
        public static string APP_ID
        {
            get
            {
                return GetValue("Alisoft.APP_ID");
            }
        }
        /// <summary>
        /// Alisoft.
        /// </summary>
        public static string CERT_CODE
        {
            get
            {
                return GetValue("Alisoft.CERT_CODE");
            }
        }

        #endregion

        #region Static Methods

        public static string GetValue(string key)
        {
            string value = ConfigurationManager.AppSettings[key];

            if (string.IsNullOrEmpty(value))
            {
                throw new InvalidOperationException(string.Format("The application setting key '{0}' is not set", key));
            }

            return value;
        }

        #endregion
    }
}
